package datapool.item
{
	import datapool.define.ItemTypeDefine;
	import datapool.define.IDZoneDefine;
	/**
	 * @author Administrator
	 */
	public class ItemPool
	{
		private var _items:Array;
		
		public function ItemPool():void
		{
			init();
		}
		
		private function init():void
		{
			_items = [];
		}
		
		public function getItemBaseInfoById(id:uint):ItemBaseInfo
		{
			var i:int;
			var itemBase:ItemBaseInfo;
			for(i=0; i<_items.length; i++)
			{
				itemBase = _items[i] as ItemBaseInfo;
				if (itemBase.itemID == id)
				{
					return itemBase;
				}
			}
			return null;
		}
		
		public function getItemTypeById(itemID:uint):int
		{
			if (itemID>=IDZoneDefine.ID_EQUIP_START && itemID<=IDZoneDefine.ID_EQUIP_END)
			{
				return ItemTypeDefine.ITEM_EUIQP;
			}

			return ItemTypeDefine.ITEM_NONE;
		}
	}
}
